#pragma once
#include "eventloop.h"
#include "tinyrpc/base/noncopyable.h"
#include <vector>
#include <memory>
#include "tinyrpc/base/thread.h"
#include "tinyrpc/net/eventloopthread.h"
namespace TinyRPC{
class EventLoopThreadPool : public Noncopyable{
public:
    EventLoopThreadPool(int threadNum);
    void start();
    EventLoop* getNextLoop(uint32_t nextLoopIndex){
        return m_eventLoops[nextLoopIndex];
    }
    bool empty(){
        return m_eventLoops.empty();
    }

    void quit();
private:
    int m_threadNum;
    std::vector<std::unique_ptr<EventLoopThread>> m_threadPool;
    std::vector<EventLoop*> m_eventLoops;
};
}
